import {Component, ViewChild} from '@angular/core';
import {NavController, Platform, Tabs} from 'ionic-angular';
import {StatusBar} from '@ionic-native/status-bar';

import {AboutPage} from '../about/about';
import {ContactPage} from '../contact/contact';
import {ProductPage} from '../product/product';
import {HomePage} from '../home/home';
import {MinePage} from '../mine/mine';
import {Helper} from "../../common/Helper";

@Component({
  selector: 'page-tabs',
  templateUrl: 'tabs.html'
})
export class TabsPage {

  homePage = HomePage;
  aboutPage = AboutPage;
  productPage = ProductPage;
  contactPage = ContactPage;
  minePage = MinePage;

  @ViewChild('myTabs') tabRef: Tabs;

  constructor(public platform: Platform,
              public statusBar: StatusBar,
              public navCtrl: NavController) {
    // this.navCtrl.setRoot(this.minePage)
  }

  ionViewDidEnter() {
    console.log('select')
    // this.tabRef.select(2)
    this.platform.ready().then(() => {
      if (this.platform.is('android')) {
        setTimeout(() => {
          this.statusBar.hide()
          this.statusBar.show()
          this.statusBar.overlaysWebView(true)
          this.statusBar.styleLightContent()
          this.statusBar.backgroundColorByHexString('#55000000')
        }, 500)
      }
    })
  }
}
